package com.yc.spring.bbs.dao;

import com.yc.spring.bbs.bean.User;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Primary
public class UserDaoImpl implements UserDao{
    @Override
    public void insert(User user) {
        System.out.println("==============================insert======================================");
    }

    @Override
    public void update(User user) {
        System.out.println("======update======");
    }

    @Override
    public void delete(User user) {
        System.out.println("======delete======");
    }

    @Override
    public void selectOne(Object id) {
//        int i = 1/0;
        System.out.println("======selectOne======");
    }

    @Override
    public List<User> selectList(User user, Integer page, Integer rows) {
        return null;
    }

    @Override
    public long count(User user) {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("=====================UserDaoImpl======================");
        return 0;
    }
}
